home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SCI Games E3 2005 Press Kit (USA)
/
SCI Games E3 2005 Press Kit (USA).bin
/
runme_mac.swf
/
scripts
/
frame_22
/
DoAction.as
Wrap
Text File
|
2005-05-05
|
5KB
|
154 lines
function LoadXml()
{
gamesXML = new XML();
gamesXML.ignoreWhite = true;
gamesXML.load("data/content/games.xml");
gamesXML.onLoad = CheckData;
}
function CheckData(success)
{
if(success)
{
chkData = "Load successful";
CM_dataxml();
}
else
{
chkData = "error";
stop();
}
}
function CM_dataxml()
{
var _loc19_ = 0;
var _loc18_ = gamesXML.firstChild;
totalGames = _loc18_.childNodes;
trace(totalGames.length);
x = 0;
while(x < totalGames.length)
{
GameContent = totalGames[x].childNodes;
ii = 0;
while(ii < GameContent.length)
{
if(GameContent[ii].nodeName.toLowerCase() == "title")
{
var _loc14_ = "" + GameContent[ii].firstChild.nodeValue + "";
}
if(GameContent[ii].nodeName.toLowerCase() == "title_icon")
{
var _loc15_ = "" + GameContent[ii].firstChild.nodeValue + "";
}
if(GameContent[ii].nodeName.toLowerCase() == "story")
{
var _loc16_ = "" + GameContent[ii].firstChild.nodeValue + "";
}
if(GameContent[ii].nodeName.toLowerCase() == "title_banner")
{
var _loc17_ = "" + GameContent[ii].firstChild.nodeValue + "";
}
if(GameContent[ii].nodeName.toLowerCase() == "features")
{
var _loc1_ = 0;
var _loc5_ = new Array();
var _loc11_ = new Array();
_loc5_ = GameContent[ii].childNodes;
while(_loc1_ <= _loc5_.length)
{
if(_loc5_[_loc1_].nodeName.toLowerCase() == "feat_id")
{
_loc11_[_loc1_] = "" + _loc5_[_loc1_].firstChild.nodeValue + "";
}
_loc1_ = _loc1_ + 1;
}
}
if(GameContent[ii].nodeName.toLowerCase() == "media")
{
var _loc2_ = 0;
var _loc3_ = new Array();
_loc3_ = GameContent[ii].childNodes;
while(_loc2_ <= _loc3_.length)
{
if(_loc3_[_loc2_].nodeName.toLowerCase() == "screens")
{
_loc1_ = 0;
var _loc4_ = new Array();
var _loc8_ = new Array();
_loc4_ = _loc3_[_loc2_].childNodes;
while(_loc1_ <= _loc4_.length)
{
if(_loc4_[_loc1_].nodeName.toLowerCase() == "screen_id")
{
_loc8_[_loc1_] = "" + _loc4_[_loc1_].firstChild.nodeValue + "";
}
_loc1_ = _loc1_ + 1;
}
}
if(_loc3_[_loc2_].nodeName.toLowerCase() == "video")
{
var _loc13_ = "" + _loc3_[_loc2_].firstChild.nodeValue + "";
}
if(_loc3_[_loc2_].nodeName.toLowerCase() == "packshot")
{
var _loc12_ = "" + _loc3_[_loc2_].firstChild.nodeValue + "";
}
_loc2_ = _loc2_ + 1;
}
}
if(GameContent[ii].nodeName.toLowerCase() == "quotes")
{
_loc1_ = 0;
var _loc6_ = new Array();
var _loc9_ = new Array();
_loc6_ = GameContent[ii].childNodes;
while(_loc1_ <= _loc6_.length)
{
if(_loc6_[_loc1_].nodeName.toLowerCase() == "quote")
{
_loc9_[_loc1_] = "" + _loc6_[_loc1_].firstChild.nodeValue + "";
}
_loc1_ = _loc1_ + 1;
}
}
if(GameContent[ii].nodeName.toLowerCase() == "requirements")
{
_loc1_ = 0;
var _loc7_ = new Array();
var _loc10_ = new Array();
_loc7_ = GameContent[ii].childNodes;
while(_loc1_ <= _loc7_.length)
{
if(_loc7_[_loc1_].nodeName.toLowerCase() == "platform")
{
_loc10_[_loc1_] = "" + _loc7_[_loc1_].attributes.type + "";
}
_loc1_ = _loc1_ + 1;
}
}
ii++;
}
GamesData[x] = new CMGame(_loc14_,_loc15_,_loc17_,_loc16_,_loc11_,_loc8_,_loc13_,_loc12_,_loc9_,_loc10_);
x++;
}
play();
}
function CMGame(t, ti, tb, s, fe, sc, vid, ps, qu, re)
{
this.title = t;
this.titleIcon = ti;
this.titleBanner = tb;
this.story = s;
this.features = fe;
this.sceenshots = sc;
this.video = vid;
this.packshot = ps;
this.quotes = qu;
this.requirment = re;
}
chkData = "Loading Data";
GamesData = new Array();
totalGames = new Array();
GameContent = new Array();
LoadXml();
stop();